﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VentaElectrodomesticos.EfectuarPago;

namespace VentaElectrodomesticos.AbmCliente
{
    public partial class FormElegirCliente : Form
    {
        private FormEfectuarPago form;

        public FormElegirCliente(FormEfectuarPago form)
        {
            InitializeComponent();
            this.form = form;
        }

        public void insertarFila(String id, String dni, String nombre, String apellido, String mail, String telefono, String direccion, String provincia)
        {
            dataGridView1.Rows.Add(id, dni, nombre, apellido, mail, telefono, direccion, provincia);
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            form.clienteSeleccionado((String)dataGridView1[2, e.RowIndex].Value,//nombre
                                     (String)dataGridView1[3, e.RowIndex].Value, //apellido 
                                     (String)dataGridView1[1, e.RowIndex].Value, //dni 
                                     (String)dataGridView1[7, e.RowIndex].Value, //provincia
                                     (String)dataGridView1[0, e.RowIndex].Value); //id
            this.Close();
        }

    }
}
